import svc
CONTROL_PARAMETER_TRACK_NAME_PREFIX = 'CP_'

class EveAnimationClient(svc.animationClient):
    __guid__ = 'svc.eveAnimationClient'
    __replaceservice__ = 'animationClient'

    def __init__(self):
        svc.animationClient.__init__(self)



    def _ProcessMorphemeDiscreteEvent(self, animationController, animRef, trackID, eventUserData, trackUserData):
        controllerTracks = animationController.GetEventTrackIDs()
        trackName = animationController.GetEventTrackName(trackID)
        if (trackName.startswith(CONTROL_PARAMETER_TRACK_NAME_PREFIX) and (animationController.GetControlParameter(trackName[3:]) is not None)):
            animationController.SetControlParameter(trackName[3:], eventUserData)



    def _AnimationSetupHook(self, entity, component):
        self.RegisterAnimationController(component.controller, audioCueFile=None)




